// externe javascript file in combinatie met masterpage nog niet aan de praat gekregen
// work-around: javascript op aspx-pagina zelf...

var mouseDown = false;

window.onload = function () {
    document.onselectstart = function () { return false; } // ie
    document.onmousedown = function () { return false; } // mozilla
    document.onmouseup = function () { mouseDown = false; }
}

// set cell status
function ColorCell(cell) {
    if (mouseDown) {
        if (cell.innerHTML == "Open") {
            cell.style.backgroundColor = "white";
            cell.innerHTML = "Test";
        } else {
            cell.style.backgroundColor = "lightgreen";
            cell.innerHTML = "Open";
        }
    }
}

////////////////////
// standard cells //
////////////////////
function MouseDown(cell) {
    mouseDown = true;
    ColorCell(cell);
}

function MouseOver(cell) {
    ColorCell(cell);
}

function MouseUp(cell) {
    mouseDown = false;
}


///////////////
// top cells //
///////////////
function MouseDownTopCell(cell, column) {
    alert("MouseDown - Column: " + column);

}

function MouseOverTopCell(cell, column) {
    //alert("MouseOver - Column: " + column);
}

function MouseUpTopCell(cell, column) {
    alert("MouseUp - Column: " + column);
}


/////////////////
// first cells //
/////////////////
function MouseDownFirstCell(cell, row) {
    alert("MouseDown - Row: " + row);
    var cells = document.getElementById("scheduleTable").rows[row].cells; // to do...
    for (var i = 0; i < cells.length; i++) {
        ColorCell(cells[i]);
    }
}

function MouseOverFirstCell(cell, row) {
    //alert("MouseOver - Row: " + row);
}

function MouseUpFirstCell(cell, row) {
    alert("MouseUp - Row: " + row);
}